<template>
  <!-- 详情 -->
  <el-dialog title="车辆信息详情" :visible.sync="dialogVisible" width="50%" append-to-body :close-on-click-modal="false"
             :before-close="closedialog">
    <el-descriptions :column="2" border>
      <el-descriptions-item>
        <template slot="label">
          车牌号
        </template>
        {{ form.plateNumber }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">
          车牌颜色
        </template>
        {{ form.plateColorName }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">
          能源类型
        </template>
        <dict-tag :options="dict.type.energy_type" :value="form.energyTypeName"/>
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">
          价格
        </template>
        {{ form.vin }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">
          购车日期
        </template>
        {{ form.purchaseDate }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">
          发动机号
        </template>
        {{ form.engineNum }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">
          年审日期
        </template>
        {{ form.annualReviewTime }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">
          车辆道路运输证号
        </template>
        {{ form.vehicleTransportationLicenseNum }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">
          车辆道路运输证
        </template>
        {{ form.vehicleTransportationLicenseUrl }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">
          车辆道路运输证到期时间
        </template>
        {{ form.vehicleTransportationLicenseEndTime }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">
          强制报废时间
        </template>
        {{ form.compulsoryScrapTime }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">
          行驶证照片正面
        </template>
        {{ form.vehicleLicenseHomeUrl }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">
          行驶证照片反面
        </template>
        {{ form.vehicleLicenseViceUrl }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">
          行驶证号
        </template>
        {{ form.vehicleLicenseNum }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">
          车辆照片
        </template>
        {{ form.vehiclePhotoUrl }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">
          机动车登记证
        </template>
        {{ form.vehicleRegistrationCertificateUrl }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">
          etc卡号
        </template>
        {{ form.etcAccountNum }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">
          车辆类型
        </template>
        <dict-tag :options="dict.type.yj_vehicle_type" :value="form.vehicleType"/>
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">
          行驶证到期日
        </template>
        {{ form.vehicleLicenseEndTime }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">
          交强险到期日
        </template>
        {{ form.compulsoryTrafficInsurance }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">
          商业险到期日
        </template>
        {{ form.commercialInsurance }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">
          关联企业
        </template>
        {{ form.enterpriseId }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">
          同步状态(0-未发送，1-已发送)
        </template>
        <dict-tag :options="dict.type.sync_status" :value="form.syncStatus"/>
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">
          同步人
        </template>
        {{ form.syncBy }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">
          同步时间
        </template>
        {{ form.syncTime }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">
          创建人
        </template>
        {{ form.createBy }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">
          创建时间
        </template>
        {{ form.createTime }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">
          更新人
        </template>
        {{ form.updateBy }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">
          更新时间
        </template>
        {{ form.updateTime }}
      </el-descriptions-item>
    </el-descriptions>
    <div slot="footer" class="dialog-footer" style="text-align: center;">
      <el-button @click="closedialog">关闭</el-button>
    </div>
  </el-dialog>
</template>

<script>
import {getYjVehicleInfo} from "@/api/miniapp/yjVehicleInfo";

export default {
  props: {
    dict: {}
  },
  data() {
    return {
      //显示详情
      dialogVisible: false,
      form: {
        id: null,
        plateNumber: null,
        plateColorName: null,
        energyTypeName: null,
        vin: null,
        purchaseDate: null,
        engineNum: null,
        annualReviewTime: null,
        vehicleTransportationLicenseNum: null,
        vehicleTransportationLicenseUrl: null,
        vehicleTransportationLicenseEndTime: null,
        compulsoryScrapTime: null,
        vehicleLicenseHomeUrl: null,
        vehicleLicenseViceUrl: null,
        vehicleLicenseNum: null,
        vehiclePhotoUrl: null,
        vehicleRegistrationCertificateUrl: null,
        etcAccountNum: null,
        vehicleType: null,
        vehicleLicenseEndTime: null,
        compulsoryTrafficInsurance: null,
        commercialInsurance: null,
        enterpriseId: null,
        syncStatus: null,
        syncBy: null,
        syncTime: null,
        createBy: null,
        createTime: null,
        updateBy: null,
        updateTime: null
      }
    }
  },
  methods: {
    open(row) {
      this.dialogVisible = true;
      this.loadDetail(row);
    },
    closedialog() {
      this.dialogVisible = false
    },
    // 获取详情
    loadDetail(row) {
      getYjVehicleInfo(row.id).then((res) => {
        if (res.code == 200) {
          this.form = res.data;
        }
      });
    },
  }
};
</script>

<style>

</style>
